-
Notifications
You must be signed in to change notification settings - Fork 368
Add buildpack audit events #4741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c3b57b4 to
0dd0e1d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds comprehensive audit event logging for buildpack lifecycle operations (create, update, and delete). The implementation follows established patterns in the codebase and ensures that all buildpack management operations are properly tracked through audit events.
Key changes:
- Added buildpack audit event recording for create, update, and delete operations
- Created a new
BuildpackEventRepositoryfollowing existing repository patterns - Updated all three buildpack action classes to accept
user_audit_infoand record events - Added comprehensive test coverage for the new audit events
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
app/repositories/buildpack_event_repository.rb |
New repository implementing audit event recording methods for buildpack create, update, and delete operations |
app/repositories/event_types.rb |
Added three new event type constants for buildpack lifecycle events |
app/actions/buildpack_create.rb |
Updated to accept user_audit_info and record audit events after successful creation |
app/actions/buildpack_update.rb |
Updated to accept user_audit_info and record audit events after successful updates |
app/actions/buildpack_delete.rb |
Updated to accept user_audit_info and record audit events before deletion |
app/controllers/v3/buildpacks_controller.rb |
Updated to pass user_audit_info to all three action classes |
spec/unit/actions/buildpack_create_spec.rb |
Added test coverage for audit event creation with comprehensive assertions |
spec/unit/actions/buildpack_update_spec.rb |
Added test coverage for audit event updates with comprehensive assertions |
spec/unit/actions/buildpack_delete_spec.rb |
Added test coverage for audit event deletion with comprehensive assertions |
spec/unit/repositories/event_types_spec.rb |
Added buildpack event types to the expected event types list |
docs/v3/source/includes/resources/audit_events/_header.md.erb |
Added documentation for the new buildpack audit event types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| BUILDPACK_CREATE = 'audit.buildpack.create'.freeze, | ||
| BUILDPACK_UPDATE = 'audit.buildpack.update'.freeze, | ||
| BUILDPACK_DELETE = 'audit.buildpack.delete'.freeze, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think BUILDPACK_UPLOAD would be a big part of the buildpack narrative we'd want to include in audit logs: https://v3-apidocs.cloudfoundry.org/version/3.209.0/index.html#upload-buildpack-bits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll approve this for now, but we should consider adding buildpack upload audit event in a future PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will open a new PR for it 👍
Changes in cloud_controller_ng:
- Add buildpack audit events
PR: cloudfoundry/cloud_controller_ng#4741
Author: Sam Gunaratne <[email protected]>
Benjamintf1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
Thanks for contributing to cloud_controller_ng. To speed up the process of reviewing your pull request please provide us with:
A short explanation of the proposed change:
An explanation of the use cases your change solves
Links to any other associated PRs
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
mainbranchI have run all the unit tests using
bundle exec rakeI have run CF Acceptance Tests